a = int(input())


def e(x):
    q = 1
    if x == 0:
        return 1
    for i in range(1, x+1):
        q *= i
    return q


def p(x):
    s = 0
    if x == 0:
        return 1
    for i in range(1, x+1):
        s = s + e(i)
    return s


print(p(a))
print(e(a))